package com.zzl.finance.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zzl.finance.order.dto.OrderInvoiceTotalInfoDto;
import com.zzl.general.common.exception.SysException;
import com.zzl.general.common.serurity.entity.User;
import com.zzl.general.common.utils.PageUtils;
import com.zzl.finance.order.entity.OrderInvoiceEntity;
import com.zzl.finance.order.dto.OrderInvoiceAddDto;
import com.zzl.finance.order.dto.OrderInvoiceUpdateDto;

import java.util.List;
import java.util.Map;

/**
 * @author sunpp
 * @date 2022-03-07 10:41:16
 */
@SuppressWarnings("javadoc")
public interface OrderInvoiceService extends IService<OrderInvoiceEntity> {

    /**
     * 通过订单id 查发票List
     *
     * @param orderId
     * @return
     */
    List<OrderInvoiceEntity> getOrderInvoice(String orderId);

    /**
     * 分页查询
     *
     * @param params 查询参数
     * @param user
     * @return 分页数据
     */
    PageUtils queryPage(Map<String, Object> params, User user);

    /**
     * 新增
     *
     * @param orderInvoiceAddDto 新增实体
     * @param user               当前登录用户
     * @throws SysException 业务异常
     */
    void saveOrderInvoice(OrderInvoiceAddDto orderInvoiceAddDto, User user) throws SysException;

    /**
     * 修改
     *
     * @param orderInvoiceUpdateDto 修改实体
     * @param user                  当前登录用户
     * @throws SysException 业务异常
     */
    void updateOrderInvoiceById(OrderInvoiceUpdateDto orderInvoiceUpdateDto, User user) throws SysException;

    /**
     * 退票
     *
     * @param orderInvoice
     * @param user
     */
    void updateInvoiceStatus(OrderInvoiceUpdateDto orderInvoice, User user) throws SysException;

    OrderInvoiceTotalInfoDto getOrderInvoiceTotalInfoDto(User user);


    OrderInvoiceEntity info(String id);
}

